import { http } from "@/utils/http";
import baseUrlProxy from "@/api/baseUrlProxy";
import qs from "qs";

export const getLogsList = (data?: object) => {
  return http.request<any>("get", baseUrlProxy + "/api/logs", {
    params: data,
    paramsSerializer: function (params: any) {
      return qs.stringify(params, { arrayFormat: "repeat" });
    }
  });
};
export const delLogsList = () => {
  return http.request<any>("delete", baseUrlProxy + "/api/logs/del/info");
};

export const exportLogsList = (data?: object) => {
  return http.request<any>(
    "get",
    baseUrlProxy + "/api/logs/download",
    {
      params: data,
      paramsSerializer: function (params: any) {
        return qs.stringify(params, { arrayFormat: "repeat" });
      }
    },
    { responseType: "blob" }
  );
};
